package com.ifighter.service.user;

import java.sql.SQLException;

import android.database.Cursor;

public class User {

	public static final String TABLE = "USER";

	private String sName;
	private String sLastname;
	private String sNickanme;
	private String sPassword;
	private String sEmail;

	/**
	 * 
	 * @param cursor
	 * @throws SQLException
	 */
	public User (Cursor cursor) throws SQLException{

		this.sName     = cursor.getString(cursor.getColumnIndex("NAME"))     != null ? cursor.getString(cursor.getColumnIndex("NAME"))     : "";
		this.sLastname = cursor.getString(cursor.getColumnIndex("LASTNAME")) != null ? cursor.getString(cursor.getColumnIndex("LASTNAME")) : "";
		this.sNickanme = cursor.getString(cursor.getColumnIndex("NICKNAME")) != null ? cursor.getString(cursor.getColumnIndex("NICKNAME")) : "";
		this.sPassword = cursor.getString(cursor.getColumnIndex("PASSWORD")) != null ? cursor.getString(cursor.getColumnIndex("PASSWORD")) : "";
		this.sEmail    = cursor.getString(cursor.getColumnIndex("EMAIL"))    != null ? cursor.getString(cursor.getColumnIndex("EMAIL"))    : "";
	}

	public String getsName() {
		return sName;
	}

	public void setsName(String sName) {
		this.sName = sName;
	}

	public String getsLastname() {
		return sLastname;
	}

	public void setsLastname(String sLastname) {
		this.sLastname = sLastname;
	}

	public String getsNickanme() {
		return sNickanme;
	}

	public String getsPassword() {
		return sPassword;
	}

	public void setsPassword(String sPassword) {
		this.sPassword = sPassword;
	}

	public String getsEmail() {
		return sEmail;
	}

	public void setsEmail(String sEmail) {
		this.sEmail = sEmail;
	}
}